package com.itheima.task;

import cn.hutool.core.date.DateUtil;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyTask {

    @Scheduled(cron = "0/30 * * * * ?")//从0秒开始,每5秒执行一次
    public void printTime(){
        System.out.println(DateUtil.formatDateTime(new Date())+"--键盘敲烂,薪资过万");
    }
}
